package com.itheima.core.service.product;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.core.dao.product.ColorDao;
import com.itheima.core.pojo.product.Color;
import com.itheima.core.pojo.product.ColorQuery;

/**
 * @author zhang.cheng
 *
 * 2017年3月2日
 */
@Service("colorService")
@Transactional
public class ColorServiceImpl implements ColorService {

	@Autowired
	private ColorDao colorDao;
	
	@Override
	public List<Color> selectColorList() {
		ColorQuery colorQuery = new ColorQuery();
		colorQuery.createCriteria().andParentIdNotEqualTo(0L);
		List<Color> colors = colorDao.selectByExample(colorQuery);
		return colors;
	}

}
